#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
int main()
{
	int n = 0;
	cin >> n;
	while (n) {
		cout << n % 10 << endl;
		n /= 10;
	}
	return 0;
}